#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "reader.h"
#include <QMainWindow>

using namespace std;
using namespace cv;

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow {
    Q_OBJECT

public:
    explicit MainWindow(QWidget* parent = 0);
    ~MainWindow();

private slots:
    void imageUpdate(Mat* img_in);

    void on_pushButton_snapshot_clicked();

    void on_pushButton_edge_clicked(bool checked);

    void on_pushButton_bin_clicked(bool checked);

    void on_horizontalSlider_valueChanged(int value);

private:
    void on_image_show(Mat& img);
    void edge_detection(Mat& img_in, Mat& img_out);
    void image_binary(Mat& img_in, Mat& img_out);

private:
    Ui::MainWindow* ui;

    Reader* reader;
    Mat img;
    Mat img_show;

    bool reader_ok;
    bool show_edge;
    bool show_bin;
    int threshold;
};

#endif // MAINWINDOW_H
